<!-- tab -->
<template>

  <div class="xy-tab">
    <div :class="['tab-list', {'tab-active': select === item.value}]" v-for="item in options" :key="item.value" @click="handleTab(item)">
      <span>
        {{item.label}}
        <i class="is-have" v-if="item.isHave"></i>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  data () {
    return {
      select: ''
    }
  },
  props: {
    options: {
      type: Array,
      default: () => []
    },
    value: {
      type: String || Number,
      default: ''
    }
  },
  methods: {
    handleTab (val) {
      this.select = val.value
      this.$emit('input', this.select)
    }
  }
}

</script>
